package zmee.pmct.opplugin;

import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
import kd.bos.entity.plugin.args.BeforeOperationArgs;
import kd.bos.ksql.util.StringUtil;

public class BeforeSavexmysOp extends AbstractOperationServicePlugIn {

    @Override
    public void beforeExecuteOperationTransaction(BeforeOperationArgs e) {
        super.beforeExecuteOperationTransaction(e);
        DynamicObject[] dataEntities = e.getDataEntities();
        for (DynamicObject dynamicObject : dataEntities) {
            String formularkey_value = dynamicObject.getString("zmee_formularkey_value");
            if (!StringUtil.isEmpty(formularkey_value)){
                String[] split = formularkey_value.split(":");
                dynamicObject.set(split[0],split[1]);
            }

        }
    }
}
